package com.zhuhjay.common.base.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import static com.zhuhjay.common.base.constant.ApplicationConstant.*;

/**
 * @author ZhuHJay
 * @date 2023/2/25 0:19
 */
@Data
@Component
@ConfigurationProperties(prefix = "generic-boot.system")
public class SystemConfig {

    private String author = "Zhuhjay";
    private String name = "ToolsBoot";
    private String version = "1.0.0";
    private String profileLocation;
    private Integer port = 80;

    /** 获取头像存储路径 */
    public String getAvatarPath() {
        return profileLocation + PATH_SEPARATOR + AVATAR_PATH;
    }

    /** 获取上传文件存储路径 */
    @Deprecated
    public String getUploadPath() {
        return profileLocation + PATH_SEPARATOR + UPLOAD_PATH;
    }

    /** 获取文件系统存储路径 */
    public String getFileSystemPath() {
        return profileLocation + PATH_SEPARATOR + FILE_SYSTEM_PATH;
    }

    /** 获取图床存储路径 */
    public String getPictureBedPath() {
        return profileLocation + PATH_SEPARATOR + PICTURE_BED_PATH;
    }

    /** 获取临时文件存储路径 */
    public String getTempPath() {
        return profileLocation + PATH_SEPARATOR + TEMP_PATH;
    }
}
